const { readFile, baseUrl, request } = require('../base.js');
const Cookie = readFile('Cookie.txt');    //用户Cookie

/* 查询详情
* 传入参数 @params: {
*    lotid:类型
*    issue:期号
*    isone:年份
* }
*/
module.exports = async function findDetail(lotid = '3d', issue = null, isone = 0) {
    try {
      const url = `${baseUrl}/api/kaijiang/getdetail?lotid=${lotid}&issue=${issue}&isone=${isone}`;
      let res = await request({
        url,
        headers: {
            "accept": "*/*",
            "content-type": "json/application; charset=utf-8",
            "cookie": Cookie,
            "Referer": `${baseUrl}/kj/list-${lotid}.html`,
        },
        body: ``,
        method: "POST"
      });
      return res;
    } catch (error) {
      return error;
    }
  }